#ifndef FileData_First
#define FileData_First
#ifdef __GNUG__
#pragma interface
#endif

#include "Data.h"

//---- FileData ----------------------------------------------------------------

class FileData : public Data {
protected:
	bool lookDeep;
	Converter *converter;

	void WhatType(bool deep= FALSE);
public:
	MetaDef(FileData);
	FileData(const char *nm, bool lookDeep= TRUE);
				// lookDeep indicates that the contents of the file is
				// considered for determining a file type
	~FileData();

	const char *FullName();
	const char *ShortName();
	const char *GetLoadDir();
	const char *GetBaseName()
		{ return ShortName(); }
	const char *PathName()
		{ return FullName(); }
	void SetName(const char *nm);
	Converter *GetConverter();
	void SetConverter(Converter*);

	StreamBuf *GetStreamBuf(bool forwriting);
	void StartUpdate();
	void EndUpdate(bool isok, bool removebackup);

	SeqCollection *GetContents();
	Data *GetParent();

	OStream& PrintOn(OStream&);
	IStream& ReadFrom(IStream&);

protected:
	u_long UpdateFields(u_long flags);
	Object *MakeObject(Class *want);
};

#endif
